﻿@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<script>
    var keyValue = $.request("keyValue");
    $(function () {
        $.ajax({
            url: "/ArticleManage/Article/GetFormJson",
            data: { keyValue: keyValue },
            dataType: "json",
            async: false,
            success: function (data) {
                $("#detailform").formSerialize(data);
                $("#detailform").find('.form-control,select,input').attr('readonly', 'readonly');
                $("#detailform").find('.parentLayer').attr('disabled', true);
                $("#detailform").find('div.ckbox label').attr('for', '');
            }
        });
    })

    function submitForm() {
        if (!$('#detailform').formValid()) {
            return false;
        }
        var content = UE.getEditor('content').getContent();
        var jsondata = $("#form1").formSerialize();
        delete (jsondata.undefined);
        jsondata.content = content;
        $.submitForm({
            url: "/ArticleManage/Article/SubmitForm?keyValue=" + keyValue,
            param: jsondata,
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
                //$('#form1').close();
            }
        })
    }
</script>
<form id="detailform">
        <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#">基本信息</a></li>
            </ul>
        
            <div style="padding-top: 20px; margin-right: 30px;">
                   <table class="form">
                    <tr>
                        <th class="formTitle">文章标题<span style="color:red;">*</span></th>
                        <td class="formValue">
                            <input id="title" name="title" type="text" class="form-control required parentLayer" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">作者<span style="color:red;">*</span></th>
                        <td class="formValue">
                            <input id="author" name="author" type="text" class="form-control required parentLayer" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">文章内容</th>
                        <td class="formValue">
                            <textarea id="content" name="content" style="width:100%;" readonly></textarea>
                        </td>
                    </tr>                                 
                </table>
            </div>
        </div>
    </form>
    <script src="~/Content/js/iColorPicker.js"></script>
    <div align="right" style="margin:5px 30px 5px 0">        
        <a class="layui-layer-btn1 btn btn-danger" onclick="history.go(-1)">返回</a>
    </div>
